home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_13_1986_Transactor_Publishing.d64
/
b-128 irq rate
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
4KB
|
82 lines
100 rem save"0:b128 irq rate",8: rem elizabeth deal malvern pa (v2)
101 ;
102 v1 went to the transactor. v3 (this) better timer-b code, and
110 ; irq mask is better
120 interrupts on the b-machines are handled by the tri-port chip at
130 $de00. it appears that any valid cia2 source, in addition to the
140 tod-alarm, can be used to interrupt.
150 ;
160 normally irqs occur at the power line frequency (bit 0 at $de02). they
170 can be turned off and replaced by another source, for instance, timer-a
180 falling through zero, as on the c64. it's a pest, but can be done.
230 ;
250 you can type the bytes under the ******** (NULL) the monitor.
260 (NULL) 15:sys 7*256 gets it (NULL)ing. the little reset button kills the project.
262 :
264 one use might be u.k. software which relies on the 50/sec irqs. you may
265 try it with superscript, start the code (NULL) the sys call above (not
267 monitor!), then load and run superscript as you normally do. my (NULL)board
268 does not bounce the (NULL)s anymore and always types correct characters.
269 :
270 ; ********
800 f0700 78 sei
801 f0701 ad 07 de lda $de07 ;clear latch & air
802 f0704 8d 07 de sta $de07
803 f0707 a9 40 lda #$40 ;set timer a for 50hz ($9c40)
804 f0709 8d 04 dc sta $dc04 ;(60hz=$8235)
805 f070c a9 9c lda #$9c
806 f070e 8d 05 dc sta $dc05
807 f0711 a9 81 lda #$81 ;icr-enable ta irqs only
808 f0713 8d 0d dc sta $dc0d
809 f0716 ad 0e dc lda $dc0e ;cra-leave 50/60hz flag alone for tod
810 f0719 29 80 and #$80 ;start ta in continuous mode
811 f071b 09 01 ora #$01
812 f071d 8d 0e dc sta $dc0e
813 f0720 ad 05 de lda $de05 ;tri-port irq mask ...
814 f0723 29 fe and #$fe ; ignore power line flips
815 f0725 09 04 ora #$04 ; enable cia2 irqs instead
816 f0727 8d 05 de sta $de05
817 f072a a9 36 lda #$36 ;switch irq routine to (*)
818 f072c 8d 00 03 sta $0300
819 f072f a9 07 lda #$07
820 f0731 8d 01 03 sta $0301
821 f0734 58 cli
823 f0735 60 rts
824 f0736 a5 01 (*) lda $01 ;irq patch
825 f0738 48 pha
826 f0739 ae 07 de ldx $de07 ;look at irq flag
827 f073c 8a txa
828 f073d 29 04 and #$04 ;was it cia2"?
829 f073f d0 04 bne $0745 ;yes, [203] around
830 f0741 8a txa ; no...
831 f0742 4c f5 fb jmp $fbf5 ; ...do usual stuff
832 f0745 ea nop ;yes [171] try 'inc $d043' here
833 f0746 ea nop
834 f0747 ea nop
835 f0748 ad 0d dc lda $dc0d ;[161][173]clear cia2[171]irq flag
836 f074b 29 02 [175] #$02 ;is ieee[171]timeout bit set"?
837 f074d f0 10 beq $075f ; nope, (NULL) around
838 f074f a9 00 lda #$00 ; yup, force it on
839 f0751 8d 06 dc sta $dc06 ; so that disk routines can see
840 f0754 8d 07 dc sta $dc07 ; this bit.
841 f0457 ad 0f dc lda $dc0f ; set timer-b for one shot mode
842 f045a 09 18 ora #$18 ; so it won't time out all the time
843 f045c 8d 0f dc sta $dc0f ; but disk will still see it once
844 f045f 4c 81 fc jmp $fc81 ;do (NULL)board scan, etc... rti
845 ;
900 some additions to the transactor v4#5 issue
901 for protecto/cbm b-128 version
905 ;
910 $de02: irq latch. poke zero to clear 1 bit, read $de07 to clr all
920 ; 7 6 8 4 3 2 1 0
930 ; not not irq acia cia1 cia2 ieee 60hz
940 ; used used pend ip srq pwr
945 ;
946 $de06: cb is unconnected (both bits are high)
947 ;
950 $dc0d: bit 1, timer b (cont.mode) is set for ieee 65ms
960 ; timeouts. bit 1 is tested only, no irqs.
965 ;
970 $dc0e: cia2 cra. bit 7 is zero (1 in u.k.) tod will use 60hz.
980 ; bit 3 is set at ioinit time - ta one shot and never used.